package com.gwcm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gwcm.exception.BusinessException;
import com.gwcm.model.dto.orderInfo.OrderInfoQueryRequest;
import com.gwcm.model.dto.orderInfo.PosSaleOrderQueryRequest;
import com.gwcm.model.entity.Product;
import com.gwcm.model.entity.Sale;
import com.gwcm.model.vo.OrderInfoVo;
import com.gwcm.model.vo.PosSaleOrderVo;
import com.gwcm.model.vo.SaleStatisticalByMonthVo;

import java.math.BigDecimal;

public interface ISaleService {

    /**
     * 开始新的销售
     */
    Sale makeNewSale();

    /**
     * 实例化SaleItem
     * @param product 商品对象
     * @param quantity 数量
     */
    void makeLineItem(Product product, int quantity);

    /**
     * 结束订单商品录入
     * @return 总金额
     */
    BigDecimal endSale();

    /**
     * 订单支付
     * @param cashTendered 付款金额
     * @return 找零
     */
    BigDecimal makePayment(BigDecimal cashTendered);
    /**
     * 修改订单明细数量
     * @param itemSn
     * @param quantity
     */
    void changeQuantityOfSaleItem(String itemSn, int quantity);
    /**
     * 删除订单明细
     * @param itemSn
     */
    void deleteSaleItem(String itemSn);

    /**
     * 按月统计销售数据
     * @param year
     * @return
     */
    SaleStatisticalByMonthVo statisticalByMonth(String year);
}
